//for循环即可
#include <stdio.h>

int main(void)
{
    int n;
    int sum, count;

    puts("Enter a integer:");
    scanf("%d", &n);

    for (count = 1; count <= n; count++)
        sum += count; 
    printf("sum = %d", sum);

    return 0;
}